package oktx.sample.dubbo;

import oktx.sample.dubbo.model.Shop;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created by dave on 18-5-20 上午10:44.
 */
@Mapper
public interface ShopMapper {
    @Insert("insert into shop(name, address, user_id) value (#{name}, #{address}, #{userId})")
    @Options(useGeneratedKeys = true)
    int insert(Shop book);

    @Select("select * from shop")
    List<Shop> getList();

    @Update("truncate table shop")
    int clear();
}
